package cn.other;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

/**
 * Created by wsx on 2017/1/31.
 */
@Aspect
public class LoggingAspect {

    @Before("execution(public * cn.other.CustomerBo.addCustomer())")
    public void logBefore(JoinPoint joinPoint){
        System.out.println("before the method\""+joinPoint.getSignature().getName()+"\",logBefore() is running ...");
    }

    @After("execution(public * cn.other.CustomerBo.addCustomer())")
    public void logAfter(JoinPoint joinPoint){
        System.out.println("after the method\""+joinPoint.getSignature().getName()+"\",logAfter() is running ...");
    }
}
